#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int a = 0;
	int n = 0;
	int sum = 0;
	scanf("%d", &a);
	for (int i = 0;i < 5;i++)
	{

		n = n * 10 + a;
		sum = sum + n;
	}
	printf("%d\n", sum);
}